﻿{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <!--列表部分-->
            <div id="role" class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="row common-search" style="margin-top: 10px;margin-bottom: 20px" hidden>
                        <div class="col-sm-12">
                            <form class="form-inline table-form">
                                <!--搜索项-->
                                <div class="form-group">
                                    <input type="text" name="name" placeholder="请输入名称" class="form-control">
                                </div>
                                <!--此处可自定义查询条件-->
                                <!--搜索项-->
                                {$html->search_btn()}
                            </form>
                        </div>
                    </div>
                    <div  class="toolbar">
                        {$html->toolbar()}
                        <!--此处可自定义工具栏-->
                        <!--<button class="btn btn-primary btn-sm" type="button"><i class="fa fa-plus"></i> 自定义</button>&nbsp;-->
                    </div>
                    <table class="table table-striped table-hover table-bordered"></table>
                    <input id="tableName" value="" type="hidden">
                </div>
            </div>
        </div>
        <!--/列表部分-->
    </div>
</div>
{include file="public/footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    //初始化表格
    var tableName="role";
    initTable({
        name:tableName,
        config:{
            index_url: '/admin/sys.role/loadData',
            add_url: '/admin/sys.role/add',
            del_url: '/admin/sys.role/del',
            table: tableName
        },
        columns:[
            {checkbox: true},
            {title: 'ID',field:'id'},
            {title: '角色名', field: 'name'},
            {title: '描述', field: 'about'},
            {title: '创建时间', field: 'ct'},

            {title: '操作', field: 'operate',formatter: function (value, row){
                var str="";
                var editUrl="/admin/sys.role/add?id=" +row.id ;
                var e = ' <button class="btn btn-primary btn-xs" type="button" onclick="layer_open(\''+editUrl+'\',\'编辑\')"><i class="fa fa-edit"></i> 编辑</button> ';
                str+=e;
                var delUrl="/admin/sys.role/del?id="+row.id;
                var d = '<button class="btn btn-danger btn-xs" type="button" onclick="table_del(\''+delUrl+'\',\''+tableName+'\');"><i class="fa fa-trash"></i> 删除</button>';
                str+=d;
                return str;}}
        ]
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->

<!--CRUD简称增删改查操作，存在变化的地方有：列、查询条件、工具栏、操作栏-->
